﻿/*-------------------------------------------------------------------------
* 命名空间: SiliconSelect.Base/NotifyBase
* 类       名: NotifyBase
* 功      能:  所有需要更新界面的Model都要继承这个类
* 时      间:  2023/6/21 10:02:22
* 版      本:  V1.0
* 作      者:  Fioman
* 格      言:  Talk is cheap,show me the code ^_^
*-------------------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace SiliconSelect.Base
{
    public class NotifyBase : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler? PropertyChanged;

        public void SetProperty<T>(ref T field, T value, [CallerMemberName] string properName = "")
        {
            field = value;
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(properName));
        }
    }
}
